<template>
  <div style="height: 100%">
    <div class="main-tab">
      <div id="header">
        <x-header  slot="header" :left-options="{showBack: false}" >
          <x-icon type="ios-arrow-back" slot="left" style="fill:#fff;" @click="back"></x-icon>
          <span slot="default" class="header-tit">商品</span>
          <x-icon type="ios-search-strong" slot="right" style="fill:#fff;" @click="touch"></x-icon>
        </x-header>
        <div>
          <search
            @result-click="resultClick"
            @on-change="getResult"
            :results="results"
            v-model="value"
            position="absolute"
            auto-scroll-to-top
            top="46px"
            @on-focus="onFocus"
            @on-cancel="onCancel"
            @on-submit="onSubmit"
            ref="search" v-show="touch1"></search>
        </div>
      </div>
      <div class="main-headerAndTab">
        <tab bar-active-color="#AD2532" :line-width="0" custom-bar-width="1.43rem" active-color="#AD2532" default-color="#9B9B9B" :scroll-threshold="4" >
          <tab-item active-class="active1" @click.native="change1">热门</tab-item>
          <tab-item active-class="active1" @click.native="change2">价格</tab-item>
          <tab-item active-class="active1" @click.native="change3">口碑</tab-item>
          <tab-item active-class="active1" @click.native="change4">品牌</tab-item>
        </tab>

      </div>
    </div>
  </div>
</template>

<script>
  import { Search } from 'vux'
    export default {
        name: "goods",
      components:{
        Search
      },
      methods:{
        back(){
          this.$router.go(-1)
        },
        touch(){
          this.touch1=true;
        },
        onCancel(){
          this.touch1=false;
        },
      },
      data(){
          return{
            touch1:false
          }
      }
    }
</script>

<style scoped>
  .header-tit{
    margin-top: 0.2rem;
  }
  #header{
    width: 100%;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;
  }
</style>
